<template>
	<view class="page">
		<view class="banner-list">
			<image src="../../static/img/message/message_jingxuan.jpg"></image>
		</view>
		<view class="img-list">
			<block v-for="(item,index) in imgList" :key="index">
				<view class="page-img" @click="goJump(item)">
					<image :src="item.mainImage"></image>
				</view>
			</block>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				imgList: [],
			}
		},
		onLoad: function(options) {
			//获取资讯列表数据
			this.getImg()
		},
		methods: {
			getImg: function() {
				var params = {
					typeName: '目的地精选'
				}
				this.$postApi(this.$path.NEWS_LIST, params).then(res => {
					console.log("资讯列表返回数据--------------->", res.data)
					if (res.data.success) {
						let list = res.data.data.list;
						this.imgList = list;
					} else {
						this.pub.showError(res.error.errorMessage)
					}
				})
			},
			goJump:function(item){
				let url = item.context
				window.location.href = url
			}
		}
	}
</script>

<style lang="scss" scoped>
	.page{
		padding: 0;
		margin: 0;
		background-color: #F7F7F7;
		min-height: 100%;

		image{
			width: 100%;
			height: 100%;
		}
	}
	.banner-list{
		height: 420upx;
	}
	.img-list{
		padding: 24upx;
	}
	.page-img:first-child{
		margin-top: 36upx;
	}
	.page-img {
		margin-top: 22upx;
		height: 374upx;
		image{
			border-radius: 20upx;
		}
	}
</style>
